const axios = require('axios');
const request  = {
    get: async function(url,param,contentType = 'application/json;charset=UTF-8',Accept = 'application/json;charset=UTF-8') {
        let result = await axios.get(url,{
            'headers': {
                'Accept': Accept,
                'Content-Type': contentType
            },
            'params': param,
        });
        return result;
    },
    post: async function(url,param,contentType = 'application/json;charset=UTF-8',Accept = 'application/json;charset=UTF-8') {
        let result = await axios.post(url,param,{
            'headers': {
                'Accept': Accept,
                'Content-Type': contentType
            },
        });
        return result;
    }
};

module.exports = request;